package com.example.yeujian5.yuejian5.fragment;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.yeujian5.yuejian5.Listenner.ClubDetailListener;
import com.example.yeujian5.yuejian5.R;
import com.example.yeujian5.yuejian5.bean.ClubBean;
import com.example.yeujian5.yuejian5.model.ClubModel;


public class ClubInfoFragment extends Fragment {
    private RecyclerView recyclerView;
    private Context mContext;
    private String id;
    private ClubBean info;
    private ImageView coachPhoto;
    private TextView intro,time,place;
    private  String  introduction,open_time,province_name,city_name,district_name;
    /*  private List<Club.ClubteacherEntity> Data;*/
    ClubDetailListener clubDetailListener = new ClubDetailListener() {
        @Override
        public void onResponse(ClubBean listBean) {
            info = listBean;
            initData();

        }


        @Override
        public void onFail(String msg) {

        }
    };
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState)
    {
        View view=inflater.inflate(R.layout.fragment_club_info, container, false);
       /* initRecyclerView(view);*/
        intro = (TextView) view.findViewById(R.id.intro);
        time = (TextView) view.findViewById(R.id.time);
        place=(TextView)view.findViewById(R.id.place);
        final Bundle bundle =getActivity().getIntent().getExtras();
        id = bundle.getString("id");
        ClubModel model = new ClubModel();
        model.getdetail(id, clubDetailListener);
        return  view;
    }

    public  void initData(){
        introduction=info.getIntroduction();
        open_time=info.getOpen_time();
        district_name=info.getProvince_name()+info.getCity_name()+info.getDistrict_name();
        time.setText("营业时间："+open_time);
        intro.setText("简介："+introduction);
        place.setText("地址："+district_name);
      /*  Data=info.body().getClubteacher();*/


    }
}
